package com.goldplusgold.tradedelay.app.home.live.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.goldplusgold.tradedelay.app.R;

/**
 * Created by Administrator on 2017/7/18.
 */

public class EssenceFragment extends Fragment {

    private RelativeLayout mRecyclerView;
    private String essence;
    TextView essence_text;
    TextView empty_text;
    public EssenceFragment(){
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mRecyclerView =
                (RelativeLayout) inflater.inflate(R.layout.essence_fragment, container, false);
        return mRecyclerView;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        essence_text = (TextView)mRecyclerView.findViewById(R.id.essence_text);
        empty_text = (TextView)mRecyclerView.findViewById(R.id.empty_text);
        if(this.essence != null && !"".equals(essence)){
            if(empty_text != null){
                empty_text.setVisibility(View.GONE);
                essence_text.setVisibility(View.VISIBLE);
                essence_text.setText(essence);
            }
        }

    }

    public void setEssence(String essence){
        this.essence = essence;
        if(this.essence != null && !"".equals(essence)){
            if(empty_text != null){
                empty_text.setVisibility(View.GONE);
                essence_text.setVisibility(View.VISIBLE);
                essence_text.setText(essence);
            }
        }
    }
}
